<?php

class Blocks_AdminController extends Zend_Controller_Action
{

    protected $_params;

    public function init()
    {
        parent::init();
        $this->_params = $this->_request->getParams();
    }

    public function breadcrumbAction()
    {
        // to do ...
    }

    public function menuAction()
    {
        $this->view->controller = $this->_params['controller'];
        $auth = Zend_Auth::getInstance()->getStorage('Administrator');
        $data = $auth->read();
        if (isset($data['roles'])) {
            $roles = $data['roles'];
            if (is_array($roles) && count($roles) > 0) {
                $this->view->menu = $roles;
            }
        }
    }

    public function footerAction()
    {
        // to do ...
    }

    public function qprofileAction()
    {
        // to do ...
    }

    public function qlinkAction()
    {
        // to do ...
    }

    public function messageAction()
    {
        $this->view->messages = array_merge(
                $this->_helper->flashMessenger->getMessages(), $this->_helper->flashMessenger->getCurrentMessages()
        );
        $this->_helper->flashMessenger->clearCurrentMessages();
    }

}